#include "..\PScriptLib\Def.h"
#include "..\PScriptLib\box.pst"
#include "..\PScriptLib\desk.pst"
#include "..\PScriptLib\chair.pst"
#include "..\PScriptLib\jug.pst"

Scene_OnInit()
{
	InitBoxes(g_iNumBoxes);
	InitBBoxes(g_iNumBBoxes);
	InitChairs(g_iNumChairs);
	InitDeskes(g_iNumDeskes);
	InitJugs(g_iNumJugs);
	int i;
	string name;
  
	for(i=01; i<=32; i++)
	{
		MakeString(name, "D_tpEC", i);		
		SetSceneItem(name, "name", "machine");
	}  	
}
Scene_OnLoad() 
{
	SetScene("snow", 1);
	SetScene("snowdensity", 200);
	SetScene("winddir", 50, 0, 0);
	SetScene("snowspeed", 5, 25);
	SetScene("snowsize", 5, 1);
}
TransferToArena(int characterid, int tpid)
{
	string arenaname;		
	MakeString(arenaname, "D_tpED", tpid);
	Misc("transfer", characterid, arenaname);
	Output("transfer", characterid, "to", tpid);
}
D_tpEC01_OnTouch(int id, int characterid)
{
	Output("EC01 Touched");
	TransferToArena(characterid, 1);
}

D_tpEC02_OnTouch(int id, int characterid)
{
	Output("EC02 Touched");
	TransferToArena(characterid, 2);
}
D_tpEC03_OnTouch(int id, int characterid)
{
	Output("EC03 Touched");
	TransferToArena(characterid, 3);
}

D_tpEC04_OnTouch(int id, int characterid)
{
	Output("EC04 Touched");
	TransferToArena(characterid, 4);
}

D_tpEC05_OnTouch(int id, int characterid)
{
	Output("EC05 Touched");
	TransferToArena(characterid, 5);
}

D_tpEC06_OnTouch(int id, int characterid)
{
	Output("EC06 Touched");
	TransferToArena(characterid, 6);
}

D_tpEC07_OnTouch(int id, int characterid)
{
	Output("EC07 Touched");
	TransferToArena(characterid, 7);
}

D_tpEC08_OnTouch(int id, int characterid)
{
	Output("EC08 Touched");
	TransferToArena(characterid, 8);
}

D_tpEC09_OnTouch(int id, int characterid)
{
	Output("EC09 Touched");
	TransferToArena(characterid, 9);
}

D_tpEC10_OnTouch(int id, int characterid)
{
	Output("EC10 Touched");
	TransferToArena(characterid, 10);
}

D_tpEC11_OnTouch(int id, int characterid)
{
	Output("EC11 Touched");
	TransferToArena(characterid, 11);
}

D_tpEC12_OnTouch(int id, int characterid)
{
	Output("EC12 Touched");
	TransferToArena(characterid, 12);
}

D_tpEC13_OnTouch(int id, int characterid)
{
	Output("EC13 Touched");
	TransferToArena(characterid, 13);
}

D_tpEC14_OnTouch(int id, int characterid)
{
	Output("EC14 Touched");
	TransferToArena(characterid, 14);
}

D_tpEC15_OnTouch(int id, int characterid)
{
	Output("EC15 Touched");
	TransferToArena(characterid, 15);
}

D_tpEC16_OnTouch(int id, int characterid)
{
	Output("EC16 Touched");
	TransferToArena(characterid, 16);
}

D_tpEC17_OnTouch(int id, int characterid)
{
	Output("EC17 Touched");
	TransferFromArena(characterid, 17);
}

D_tpEC18_OnTouch(int id, int characterid)
{
	Output("EC18 Touched");
	TransferFromArena(characterid, 18);
}

D_tpEC19_OnTouch(int id, int characterid)
{
	Output("EC19 Touched");
	TransferFromArena(characterid, 19);
}

D_tpEC20_OnTouch(int id, int characterid)
{
	Output("EC20 Touched");
	TransferFromArena(characterid, 20);
}

D_tpEC21_OnTouch(int id, int characterid)
{
	Output("EC21 Touched");
	TransferFromArena(characterid, 21);
}

D_tpEC22_OnTouch(int id, int characterid)
{
	Output("EC22 Touched");
	TransferFromArena(characterid, 22);
}

D_tpEC23_OnTouch(int id, int characterid)
{
	Output("EC23 Touched");
	TransferFromArena(characterid, 23);
}

D_tpEC24_OnTouch(int id, int characterid)
{
	Output("EC24 Touched");
	TransferFromArena(characterid, 24);
}

D_tpEC25_OnTouch(int id, int characterid)
{
	Output("EC25 Touched");
	TransferFromArena(characterid, 25);
}

D_tpEC26_OnTouch(int id, int characterid)
{
	Output("EC26 Touched");
	TransferFromArena(characterid, 26);
}

D_tpEC27_OnTouch(int id, int characterid)
{
	Output("EC27 Touched");
	TransferFromArena(characterid, 27);
}

D_tpEC28_OnTouch(int id, int characterid)
{
	Output("EC28 Touched");
	TransferFromArena(characterid, 28);
}

D_tpEC29_OnTouch(int id, int characterid)
{
	Output("EC29 Touched");
	TransferFromArena(characterid, 29);
}

D_tpEC30_OnTouch(int id, int characterid)
{
	Output("EC30 Touched");
	TransferFromArena(characterid, 30);
}

D_tpEC31_OnTouch(int id, int characterid)
{
	Output("EC31 Touched");
	TransferFromArena(characterid, 31);
}

D_tpEC32_OnTouch(int id, int characterid)
{
	Output("EC32 Touched");
	TransferFromArena(characterid, 32);
}
ZMJAI_OnEvent(int zmjEvt)
{
	if(zmjEvt == -1)
	{
		return -1;
	}

	if(zmjEvt == 10)
	{
		Misc("transfer", 1, "D_BBox01");
		return 11;
	}

	if(zmjEvt == 12)
	{
		int i;
		for(i=1; i<=32; i++)
		{
			StoneOnAttack(i, 1000);
			StoneOnAttack(i, 1000);
		}

		return 13;
	}
	
	return -1;
}
#include "..\PScriptLib\zmjeve.pst"